package cn.gxa.j229.bug.finance.service.contant.impl;

import cn.gxa.j229.bug.finance.mapper.EssayMapper;
import cn.gxa.j229.bug.finance.mapper.TbIdeaMapper;
import cn.gxa.j229.bug.finance.pojo.Essay;
import cn.gxa.j229.bug.finance.pojo.TbIdea;
import cn.gxa.j229.bug.finance.service.contant.TbIdeaService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author Jun
 * @version 1.0
 * @date 2020/9/25 15:05
 */

@Service("tbIdeaService")
public class TbIdeaServiceImpl implements TbIdeaService {

    @Resource
    private TbIdeaMapper tbIdeaMapper = null;

    @Override
    public int delete(Integer id) {
        return tbIdeaMapper.delete(id);
    }

    @Override
    public int insert(TbIdea tbIdea) {
        return tbIdeaMapper.insert(tbIdea);
    }

    @Override
    public List<Map<String, Object>> selectById(Integer id) {
        return tbIdeaMapper.selectById(id);
    }

    @Override
    public List<Map<String,Object>> selectCount() {
        return  tbIdeaMapper.selectCount();
    }

    @Override
    public List<Map<String, Object>> selectByIdea(String idea) {
        return tbIdeaMapper.selectByIdea(idea);
    }

    @Override
    public List<Map<String, Object>> selectByState(Integer state) {
        return tbIdeaMapper.selectByState(state);
    }

    @Override
    public List<Map<String, Object>> selectTbIdeaByPage(TbIdea tbIdea) {
        tbIdea.setLimit((tbIdea.getLimit() - 1) * tbIdea.getPage());
        return tbIdeaMapper.selectByPage(tbIdea);
    }

    @Override
    public int selectByPageCount(TbIdea tbIdea) {
        return tbIdeaMapper.selectByPageCount(tbIdea);
    }

    @Override
    public int update(TbIdea tbIdea) {
        return tbIdeaMapper.update(tbIdea);
    }
}
